import 'package:cbec_app/generated/json/base/json_convert_content.dart';
import 'package:cbec_app/entity/home/content/topic_product_entity.dart';

TopicProductEntity $TopicProductEntityFromJson(Map<String, dynamic> json) {
  final TopicProductEntity topicProductEntity = TopicProductEntity();
  final String? displayScale = jsonConvert.convert<String>(json['display_scale']);
  if (displayScale != null) {
    topicProductEntity.displayScale = displayScale;
  }
  final String? priceQz = jsonConvert.convert<String>(json['price_qz']);
  if (priceQz != null) {
    topicProductEntity.priceQz = priceQz;
  }
  final String? maskColor = jsonConvert.convert<String>(json['mask_color']);
  if (maskColor != null) {
    topicProductEntity.maskColor = maskColor;
  }
  final List<TopicProductGoods>? goods = (json['goods'] as List<dynamic>?)?.map((e) => jsonConvert.convert<TopicProductGoods>(e) as TopicProductGoods).toList();
  if (goods != null) {
    topicProductEntity.goods = goods;
  }
  final String? textAlignType = jsonConvert.convert<String>(json['text_align_type']);
  if (textAlignType != null) {
    topicProductEntity.textAlignType = textAlignType;
  }
  final TopicProductBgImage? bgImage = jsonConvert.convert<TopicProductBgImage>(json['bg_image']);
  if (bgImage != null) {
    topicProductEntity.bgImage = bgImage;
  }
  final String? uuid = jsonConvert.convert<String>(json['uuid']);
  if (uuid != null) {
    topicProductEntity.uuid = uuid;
  }
  final int? pageMarginBottom2 = jsonConvert.convert<int>(json['page_margin_bottom_2']);
  if (pageMarginBottom2 != null) {
    topicProductEntity.pageMarginBottom2 = pageMarginBottom2;
  }
  final String? bgColor2 = jsonConvert.convert<String>(json['bg_color2']);
  if (bgColor2 != null) {
    topicProductEntity.bgColor2 = bgColor2;
  }
  final List<TopicProductDefaultGoods>? defaultGoods = (json['default_goods'] as List<dynamic>?)?.map((e) => jsonConvert.convert<TopicProductDefaultGoods>(e) as TopicProductDefaultGoods).toList();
  if (defaultGoods != null) {
    topicProductEntity.defaultGoods = defaultGoods;
  }
  final bool? price = jsonConvert.convert<bool>(json['price']);
  if (price != null) {
    topicProductEntity.price = price;
  }
  final String? bgColor5 = jsonConvert.convert<String>(json['bg_color5']);
  if (bgColor5 != null) {
    topicProductEntity.bgColor5 = bgColor5;
  }
  final int? goodsMarginTop = jsonConvert.convert<int>(json['goods_margin_top']);
  if (goodsMarginTop != null) {
    topicProductEntity.goodsMarginTop = goodsMarginTop;
  }
  final int? pageMarginRight = jsonConvert.convert<int>(json['page_margin_right']);
  if (pageMarginRight != null) {
    topicProductEntity.pageMarginRight = pageMarginRight;
  }
  final List<TopicProductSubEntry>? subEntry = (json['sub_entry'] as List<dynamic>?)?.map((e) => jsonConvert.convert<TopicProductSubEntry>(e) as TopicProductSubEntry).toList();
  if (subEntry != null) {
    topicProductEntity.subEntry = subEntry;
  }
  final int? goodsMarginLeft2 = jsonConvert.convert<int>(json['goods_margin_left_2']);
  if (goodsMarginLeft2 != null) {
    topicProductEntity.goodsMarginLeft2 = goodsMarginLeft2;
  }
  final double? per = jsonConvert.convert<double>(json['per']);
  if (per != null) {
    topicProductEntity.per = per;
  }
  final double? imgTop = jsonConvert.convert<double>(json['img_top']);
  if (imgTop != null) {
    topicProductEntity.imgTop = imgTop;
  }
  final bool? bottomrds = jsonConvert.convert<bool>(json['bottomrds']);
  if (bottomrds != null) {
    topicProductEntity.bottomrds = bottomrds;
  }
  final int? pageMarginBottom = jsonConvert.convert<int>(json['page_margin_bottom']);
  if (pageMarginBottom != null) {
    topicProductEntity.pageMarginBottom = pageMarginBottom;
  }
  final String? sizeType = jsonConvert.convert<String>(json['size_type']);
  if (sizeType != null) {
    topicProductEntity.sizeType = sizeType;
  }
  final int? pageMarginTop2 = jsonConvert.convert<int>(json['page_margin_top_2']);
  if (pageMarginTop2 != null) {
    topicProductEntity.pageMarginTop2 = pageMarginTop2;
  }
  final String? borderRadiusType = jsonConvert.convert<String>(json['border_radius_type']);
  if (borderRadiusType != null) {
    topicProductEntity.borderRadiusType = borderRadiusType;
  }
  final bool? showSoldNum = jsonConvert.convert<bool>(json['show_sold_num']);
  if (showSoldNum != null) {
    topicProductEntity.showSoldNum = showSoldNum;
  }
  final String? oldpriceColor = jsonConvert.convert<String>(json['oldprice_color']);
  if (oldpriceColor != null) {
    topicProductEntity.oldpriceColor = oldpriceColor;
  }
  final String? textAlignType2 = jsonConvert.convert<String>(json['text_align_type2']);
  if (textAlignType2 != null) {
    topicProductEntity.textAlignType2 = textAlignType2;
  }
  final bool? showTitle = jsonConvert.convert<bool>(json['show_title']);
  if (showTitle != null) {
    topicProductEntity.showTitle = showTitle;
  }
  final String? subText = jsonConvert.convert<String>(json['sub_text']);
  if (subText != null) {
    topicProductEntity.subText = subText;
  }
  final String? moreText = jsonConvert.convert<String>(json['more_text']);
  if (moreText != null) {
    topicProductEntity.moreText = moreText;
  }
  final int? pageMarginTop = jsonConvert.convert<int>(json['page_margin_top']);
  if (pageMarginTop != null) {
    topicProductEntity.pageMarginTop = pageMarginTop;
  }
  final bool? showOriginPrice = jsonConvert.convert<bool>(json['show_origin_price']);
  if (showOriginPrice != null) {
    topicProductEntity.showOriginPrice = showOriginPrice;
  }
  final bool? showHd = jsonConvert.convert<bool>(json['show_hd']);
  if (showHd != null) {
    topicProductEntity.showHd = showHd;
  }
  final TopicProductLink? link = jsonConvert.convert<TopicProductLink>(json['link']);
  if (link != null) {
    topicProductEntity.link = link;
  }
  final String? imageFillStyle = jsonConvert.convert<String>(json['image_fill_style']);
  if (imageFillStyle != null) {
    topicProductEntity.imageFillStyle = imageFillStyle;
  }
  final String? cornerMarkType = jsonConvert.convert<String>(json['corner_mark_type']);
  if (cornerMarkType != null) {
    topicProductEntity.cornerMarkType = cornerMarkType;
  }
  final bool? showCornerMark = jsonConvert.convert<bool>(json['show_corner_mark']);
  if (showCornerMark != null) {
    topicProductEntity.showCornerMark = showCornerMark;
  }
  final String? imageFillStyle2 = jsonConvert.convert<String>(json['image_fill_style2']);
  if (imageFillStyle2 != null) {
    topicProductEntity.imageFillStyle2 = imageFillStyle2;
  }
  final String? mtitleColor = jsonConvert.convert<String>(json['mtitle_color']);
  if (mtitleColor != null) {
    topicProductEntity.mtitleColor = mtitleColor;
  }
  final String? textStyleType = jsonConvert.convert<String>(json['text_style_type']);
  if (textStyleType != null) {
    topicProductEntity.textStyleType = textStyleType;
  }
  final TopicProductLinkMore? linkMore = jsonConvert.convert<TopicProductLinkMore>(json['link_more']);
  if (linkMore != null) {
    topicProductEntity.linkMore = linkMore;
  }
  final String? imageFillStyle8 = jsonConvert.convert<String>(json['image_fill_style8']);
  if (imageFillStyle8 != null) {
    topicProductEntity.imageFillStyle8 = imageFillStyle8;
  }
  final TopicProductHdImage2? hdImage2 = jsonConvert.convert<TopicProductHdImage2>(json['hd_image2']);
  if (hdImage2 != null) {
    topicProductEntity.hdImage2 = hdImage2;
  }
  final TopicProductHdImage? hdImage = jsonConvert.convert<TopicProductHdImage>(json['hd_image']);
  if (hdImage != null) {
    topicProductEntity.hdImage = hdImage;
  }
  final bool? showMore = jsonConvert.convert<bool>(json['show_more']);
  if (showMore != null) {
    topicProductEntity.showMore = showMore;
  }
  final int? goodsMarginIner = jsonConvert.convert<int>(json['goods_margin_iner']);
  if (goodsMarginIner != null) {
    topicProductEntity.goodsMarginIner = goodsMarginIner;
  }
  final String? soldColor = jsonConvert.convert<String>(json['sold_color']);
  if (soldColor != null) {
    topicProductEntity.soldColor = soldColor;
  }
  final String? titleColor = jsonConvert.convert<String>(json['title_color']);
  if (titleColor != null) {
    topicProductEntity.titleColor = titleColor;
  }
  final int? pageMarginTop5 = jsonConvert.convert<int>(json['page_margin_top5']);
  if (pageMarginTop5 != null) {
    topicProductEntity.pageMarginTop5 = pageMarginTop5;
  }
  final int? bdr5 = jsonConvert.convert<int>(json['bdr5']);
  if (bdr5 != null) {
    topicProductEntity.bdr5 = bdr5;
  }
  final String? priceColor = jsonConvert.convert<String>(json['price_color']);
  if (priceColor != null) {
    topicProductEntity.priceColor = priceColor;
  }
  final int? goodsMargin = jsonConvert.convert<int>(json['goods_margin']);
  if (goodsMargin != null) {
    topicProductEntity.goodsMargin = goodsMargin;
  }
  final int? pageMarginLeft = jsonConvert.convert<int>(json['page_margin_left']);
  if (pageMarginLeft != null) {
    topicProductEntity.pageMarginLeft = pageMarginLeft;
  }
  final int? bdr = jsonConvert.convert<int>(json['bdr']);
  if (bdr != null) {
    topicProductEntity.bdr = bdr;
  }
  final String? bgColor = jsonConvert.convert<String>(json['bg_color']);
  if (bgColor != null) {
    topicProductEntity.bgColor = bgColor;
  }
  final int? goodsMarginLeft = jsonConvert.convert<int>(json['goods_margin_left']);
  if (goodsMarginLeft != null) {
    topicProductEntity.goodsMarginLeft = goodsMarginLeft;
  }
  final String? mainText = jsonConvert.convert<String>(json['main_text']);
  if (mainText != null) {
    topicProductEntity.mainText = mainText;
  }
  final String? cornerMarkImage = jsonConvert.convert<String>(json['corner_mark_image']);
  if (cornerMarkImage != null) {
    topicProductEntity.cornerMarkImage = cornerMarkImage;
  }
  final bool? soldzero = jsonConvert.convert<bool>(json['soldzero']);
  if (soldzero != null) {
    topicProductEntity.soldzero = soldzero;
  }
  return topicProductEntity;
}

Map<String, dynamic> $TopicProductEntityToJson(TopicProductEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['display_scale'] = entity.displayScale;
  data['price_qz'] = entity.priceQz;
  data['mask_color'] = entity.maskColor;
  data['goods'] = entity.goods?.map((v) => v.toJson()).toList();
  data['text_align_type'] = entity.textAlignType;
  data['bg_image'] = entity.bgImage?.toJson();
  data['uuid'] = entity.uuid;
  data['page_margin_bottom_2'] = entity.pageMarginBottom2;
  data['bg_color2'] = entity.bgColor2;
  data['default_goods'] = entity.defaultGoods?.map((v) => v.toJson()).toList();
  data['price'] = entity.price;
  data['bg_color5'] = entity.bgColor5;
  data['goods_margin_top'] = entity.goodsMarginTop;
  data['page_margin_right'] = entity.pageMarginRight;
  data['sub_entry'] = entity.subEntry?.map((v) => v.toJson()).toList();
  data['goods_margin_left_2'] = entity.goodsMarginLeft2;
  data['per'] = entity.per;
  data['img_top'] = entity.imgTop;
  data['bottomrds'] = entity.bottomrds;
  data['page_margin_bottom'] = entity.pageMarginBottom;
  data['size_type'] = entity.sizeType;
  data['page_margin_top_2'] = entity.pageMarginTop2;
  data['border_radius_type'] = entity.borderRadiusType;
  data['show_sold_num'] = entity.showSoldNum;
  data['oldprice_color'] = entity.oldpriceColor;
  data['text_align_type2'] = entity.textAlignType2;
  data['show_title'] = entity.showTitle;
  data['sub_text'] = entity.subText;
  data['more_text'] = entity.moreText;
  data['page_margin_top'] = entity.pageMarginTop;
  data['show_origin_price'] = entity.showOriginPrice;
  data['show_hd'] = entity.showHd;
  data['link'] = entity.link?.toJson();
  data['image_fill_style'] = entity.imageFillStyle;
  data['corner_mark_type'] = entity.cornerMarkType;
  data['show_corner_mark'] = entity.showCornerMark;
  data['image_fill_style2'] = entity.imageFillStyle2;
  data['mtitle_color'] = entity.mtitleColor;
  data['text_style_type'] = entity.textStyleType;
  data['link_more'] = entity.linkMore?.toJson();
  data['image_fill_style8'] = entity.imageFillStyle8;
  data['hd_image2'] = entity.hdImage2?.toJson();
  data['hd_image'] = entity.hdImage?.toJson();
  data['show_more'] = entity.showMore;
  data['goods_margin_iner'] = entity.goodsMarginIner;
  data['sold_color'] = entity.soldColor;
  data['title_color'] = entity.titleColor;
  data['page_margin_top5'] = entity.pageMarginTop5;
  data['bdr5'] = entity.bdr5;
  data['price_color'] = entity.priceColor;
  data['goods_margin'] = entity.goodsMargin;
  data['page_margin_left'] = entity.pageMarginLeft;
  data['bdr'] = entity.bdr;
  data['bg_color'] = entity.bgColor;
  data['goods_margin_left'] = entity.goodsMarginLeft;
  data['main_text'] = entity.mainText;
  data['corner_mark_image'] = entity.cornerMarkImage;
  data['soldzero'] = entity.soldzero;
  return data;
}

extension TopicProductEntityExtension on TopicProductEntity {
  TopicProductEntity copyWith({
    String? displayScale,
    String? priceQz,
    String? maskColor,
    List<TopicProductGoods>? goods,
    String? textAlignType,
    TopicProductBgImage? bgImage,
    String? uuid,
    int? pageMarginBottom2,
    String? bgColor2,
    List<TopicProductDefaultGoods>? defaultGoods,
    bool? price,
    String? bgColor5,
    int? goodsMarginTop,
    int? pageMarginRight,
    List<TopicProductSubEntry>? subEntry,
    int? goodsMarginLeft2,
    double? per,
    double? imgTop,
    bool? bottomrds,
    int? pageMarginBottom,
    String? sizeType,
    int? pageMarginTop2,
    String? borderRadiusType,
    bool? showSoldNum,
    String? oldpriceColor,
    String? textAlignType2,
    bool? showTitle,
    String? subText,
    String? moreText,
    int? pageMarginTop,
    bool? showOriginPrice,
    bool? showHd,
    TopicProductLink? link,
    String? imageFillStyle,
    String? cornerMarkType,
    bool? showCornerMark,
    String? imageFillStyle2,
    String? mtitleColor,
    String? textStyleType,
    TopicProductLinkMore? linkMore,
    String? imageFillStyle8,
    TopicProductHdImage2? hdImage2,
    TopicProductHdImage? hdImage,
    bool? showMore,
    int? goodsMarginIner,
    String? soldColor,
    String? titleColor,
    int? pageMarginTop5,
    int? bdr5,
    String? priceColor,
    int? goodsMargin,
    int? pageMarginLeft,
    int? bdr,
    String? bgColor,
    int? goodsMarginLeft,
    String? mainText,
    String? cornerMarkImage,
    bool? soldzero,
  }) {
    return TopicProductEntity()
      ..displayScale = displayScale ?? this.displayScale
      ..priceQz = priceQz ?? this.priceQz
      ..maskColor = maskColor ?? this.maskColor
      ..goods = goods ?? this.goods
      ..textAlignType = textAlignType ?? this.textAlignType
      ..bgImage = bgImage ?? this.bgImage
      ..uuid = uuid ?? this.uuid
      ..pageMarginBottom2 = pageMarginBottom2 ?? this.pageMarginBottom2
      ..bgColor2 = bgColor2 ?? this.bgColor2
      ..defaultGoods = defaultGoods ?? this.defaultGoods
      ..price = price ?? this.price
      ..bgColor5 = bgColor5 ?? this.bgColor5
      ..goodsMarginTop = goodsMarginTop ?? this.goodsMarginTop
      ..pageMarginRight = pageMarginRight ?? this.pageMarginRight
      ..subEntry = subEntry ?? this.subEntry
      ..goodsMarginLeft2 = goodsMarginLeft2 ?? this.goodsMarginLeft2
      ..per = per ?? this.per
      ..imgTop = imgTop ?? this.imgTop
      ..bottomrds = bottomrds ?? this.bottomrds
      ..pageMarginBottom = pageMarginBottom ?? this.pageMarginBottom
      ..sizeType = sizeType ?? this.sizeType
      ..pageMarginTop2 = pageMarginTop2 ?? this.pageMarginTop2
      ..borderRadiusType = borderRadiusType ?? this.borderRadiusType
      ..showSoldNum = showSoldNum ?? this.showSoldNum
      ..oldpriceColor = oldpriceColor ?? this.oldpriceColor
      ..textAlignType2 = textAlignType2 ?? this.textAlignType2
      ..showTitle = showTitle ?? this.showTitle
      ..subText = subText ?? this.subText
      ..moreText = moreText ?? this.moreText
      ..pageMarginTop = pageMarginTop ?? this.pageMarginTop
      ..showOriginPrice = showOriginPrice ?? this.showOriginPrice
      ..showHd = showHd ?? this.showHd
      ..link = link ?? this.link
      ..imageFillStyle = imageFillStyle ?? this.imageFillStyle
      ..cornerMarkType = cornerMarkType ?? this.cornerMarkType
      ..showCornerMark = showCornerMark ?? this.showCornerMark
      ..imageFillStyle2 = imageFillStyle2 ?? this.imageFillStyle2
      ..mtitleColor = mtitleColor ?? this.mtitleColor
      ..textStyleType = textStyleType ?? this.textStyleType
      ..linkMore = linkMore ?? this.linkMore
      ..imageFillStyle8 = imageFillStyle8 ?? this.imageFillStyle8
      ..hdImage2 = hdImage2 ?? this.hdImage2
      ..hdImage = hdImage ?? this.hdImage
      ..showMore = showMore ?? this.showMore
      ..goodsMarginIner = goodsMarginIner ?? this.goodsMarginIner
      ..soldColor = soldColor ?? this.soldColor
      ..titleColor = titleColor ?? this.titleColor
      ..pageMarginTop5 = pageMarginTop5 ?? this.pageMarginTop5
      ..bdr5 = bdr5 ?? this.bdr5
      ..priceColor = priceColor ?? this.priceColor
      ..goodsMargin = goodsMargin ?? this.goodsMargin
      ..pageMarginLeft = pageMarginLeft ?? this.pageMarginLeft
      ..bdr = bdr ?? this.bdr
      ..bgColor = bgColor ?? this.bgColor
      ..goodsMarginLeft = goodsMarginLeft ?? this.goodsMarginLeft
      ..mainText = mainText ?? this.mainText
      ..cornerMarkImage = cornerMarkImage ?? this.cornerMarkImage
      ..soldzero = soldzero ?? this.soldzero;
  }
}

TopicProductGoods $TopicProductGoodsFromJson(Map<String, dynamic> json) {
  final TopicProductGoods topicProductGoods = TopicProductGoods();
  final int? isCombination = jsonConvert.convert<int>(json['isCombination']);
  if (isCombination != null) {
    topicProductGoods.isCombination = isCombination;
  }
  final int? commoditySource = jsonConvert.convert<int>(json['commoditySource']);
  if (commoditySource != null) {
    topicProductGoods.commoditySource = commoditySource;
  }
  final String? className = jsonConvert.convert<String>(json['className']);
  if (className != null) {
    topicProductGoods.className = className;
  }
  final double? priceMarket = jsonConvert.convert<double>(json['priceMarket']);
  if (priceMarket != null) {
    topicProductGoods.priceMarket = priceMarket;
  }
  final int? secondClassID = jsonConvert.convert<int>(json['secondClassID']);
  if (secondClassID != null) {
    topicProductGoods.secondClassID = secondClassID;
  }
  final int? baseSpec = jsonConvert.convert<int>(json['baseSpec']);
  if (baseSpec != null) {
    topicProductGoods.baseSpec = baseSpec;
  }
  final int? number = jsonConvert.convert<int>(json['number']);
  if (number != null) {
    topicProductGoods.number = number;
  }
  final int? classId = jsonConvert.convert<int>(json['classId']);
  if (classId != null) {
    topicProductGoods.classId = classId;
  }
  final int? commodityStatus = jsonConvert.convert<int>(json['commodityStatus']);
  if (commodityStatus != null) {
    topicProductGoods.commodityStatus = commodityStatus;
  }
  final double? price = jsonConvert.convert<double>(json['price']);
  if (price != null) {
    topicProductGoods.price = price;
  }
  final double? highPrice = jsonConvert.convert<double>(json['highPrice']);
  if (highPrice != null) {
    topicProductGoods.highPrice = highPrice;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    topicProductGoods.id = id;
  }
  final String? supplierName = jsonConvert.convert<String>(json['supplierName']);
  if (supplierName != null) {
    topicProductGoods.supplierName = supplierName;
  }
  final dynamic image = json['image'];
  if (image != null) {
    topicProductGoods.image = image;
  }
  final String? brandName = jsonConvert.convert<String>(json['brandName']);
  if (brandName != null) {
    topicProductGoods.brandName = brandName;
  }
  final dynamic paySingle = json['paySingle'];
  if (paySingle != null) {
    topicProductGoods.paySingle = paySingle;
  }
  final int? priceType = jsonConvert.convert<int>(json['priceType']);
  if (priceType != null) {
    topicProductGoods.priceType = priceType;
  }
  final List<TopicProductGoodsSpecList>? specList = (json['specList'] as List<dynamic>?)?.map((e) => jsonConvert.convert<TopicProductGoodsSpecList>(e) as TopicProductGoodsSpecList).toList();
  if (specList != null) {
    topicProductGoods.specList = specList;
  }
  final int? firstClassID = jsonConvert.convert<int>(json['firstClassID']);
  if (firstClassID != null) {
    topicProductGoods.firstClassID = firstClassID;
  }
  final String? commodityId = jsonConvert.convert<String>(json['commodityId']);
  if (commodityId != null) {
    topicProductGoods.commodityId = commodityId;
  }
  final dynamic sort = json['sort'];
  if (sort != null) {
    topicProductGoods.sort = sort;
  }
  final int? commodityType = jsonConvert.convert<int>(json['commodityType']);
  if (commodityType != null) {
    topicProductGoods.commodityType = commodityType;
  }
  final String? barCode = jsonConvert.convert<String>(json['barCode']);
  if (barCode != null) {
    topicProductGoods.barCode = barCode;
  }
  final String? spuSpecJsonBody = jsonConvert.convert<String>(json['spuSpecJsonBody']);
  if (spuSpecJsonBody != null) {
    topicProductGoods.spuSpecJsonBody = spuSpecJsonBody;
  }
  final double? taxRate = jsonConvert.convert<double>(json['taxRate']);
  if (taxRate != null) {
    topicProductGoods.taxRate = taxRate;
  }
  final String? mainImage = jsonConvert.convert<String>(json['mainImage']);
  if (mainImage != null) {
    topicProductGoods.mainImage = mainImage;
  }
  final double? priceCost = jsonConvert.convert<double>(json['priceCost']);
  if (priceCost != null) {
    topicProductGoods.priceCost = priceCost;
  }
  final List<dynamic>? discountLabel = (json['discountLabel'] as List<dynamic>?)?.map((e) => e).toList();
  if (discountLabel != null) {
    topicProductGoods.discountLabel = discountLabel;
  }
  final int? commodityForm = jsonConvert.convert<int>(json['commodityForm']);
  if (commodityForm != null) {
    topicProductGoods.commodityForm = commodityForm;
  }
  final int? brandId = jsonConvert.convert<int>(json['brandId']);
  if (brandId != null) {
    topicProductGoods.brandId = brandId;
  }
  final double? highTaxRate = jsonConvert.convert<double>(json['highTaxRate']);
  if (highTaxRate != null) {
    topicProductGoods.highTaxRate = highTaxRate;
  }
  final String? skuCode = jsonConvert.convert<String>(json['skuCode']);
  if (skuCode != null) {
    topicProductGoods.skuCode = skuCode;
  }
  final String? commodityName = jsonConvert.convert<String>(json['commodityName']);
  if (commodityName != null) {
    topicProductGoods.commodityName = commodityName;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    topicProductGoods.status = status;
  }
  return topicProductGoods;
}

Map<String, dynamic> $TopicProductGoodsToJson(TopicProductGoods entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['isCombination'] = entity.isCombination;
  data['commoditySource'] = entity.commoditySource;
  data['className'] = entity.className;
  data['priceMarket'] = entity.priceMarket;
  data['secondClassID'] = entity.secondClassID;
  data['baseSpec'] = entity.baseSpec;
  data['number'] = entity.number;
  data['classId'] = entity.classId;
  data['commodityStatus'] = entity.commodityStatus;
  data['price'] = entity.price;
  data['highPrice'] = entity.highPrice;
  data['id'] = entity.id;
  data['supplierName'] = entity.supplierName;
  data['image'] = entity.image;
  data['brandName'] = entity.brandName;
  data['paySingle'] = entity.paySingle;
  data['priceType'] = entity.priceType;
  data['specList'] = entity.specList?.map((v) => v.toJson()).toList();
  data['firstClassID'] = entity.firstClassID;
  data['commodityId'] = entity.commodityId;
  data['sort'] = entity.sort;
  data['commodityType'] = entity.commodityType;
  data['barCode'] = entity.barCode;
  data['spuSpecJsonBody'] = entity.spuSpecJsonBody;
  data['taxRate'] = entity.taxRate;
  data['mainImage'] = entity.mainImage;
  data['priceCost'] = entity.priceCost;
  data['discountLabel'] = entity.discountLabel;
  data['commodityForm'] = entity.commodityForm;
  data['brandId'] = entity.brandId;
  data['highTaxRate'] = entity.highTaxRate;
  data['skuCode'] = entity.skuCode;
  data['commodityName'] = entity.commodityName;
  data['status'] = entity.status;
  return data;
}

extension TopicProductGoodsExtension on TopicProductGoods {
  TopicProductGoods copyWith({
    int? isCombination,
    int? commoditySource,
    String? className,
    double? priceMarket,
    int? secondClassID,
    int? baseSpec,
    int? number,
    int? classId,
    int? commodityStatus,
    double? price,
    double? highPrice,
    String? id,
    String? supplierName,
    dynamic image,
    String? brandName,
    dynamic paySingle,
    int? priceType,
    List<TopicProductGoodsSpecList>? specList,
    int? firstClassID,
    String? commodityId,
    dynamic sort,
    int? commodityType,
    String? barCode,
    String? spuSpecJsonBody,
    double? taxRate,
    String? mainImage,
    double? priceCost,
    List<dynamic>? discountLabel,
    int? commodityForm,
    int? brandId,
    double? highTaxRate,
    String? skuCode,
    String? commodityName,
    int? status,
  }) {
    return TopicProductGoods()
      ..isCombination = isCombination ?? this.isCombination
      ..commoditySource = commoditySource ?? this.commoditySource
      ..className = className ?? this.className
      ..priceMarket = priceMarket ?? this.priceMarket
      ..secondClassID = secondClassID ?? this.secondClassID
      ..baseSpec = baseSpec ?? this.baseSpec
      ..number = number ?? this.number
      ..classId = classId ?? this.classId
      ..commodityStatus = commodityStatus ?? this.commodityStatus
      ..price = price ?? this.price
      ..highPrice = highPrice ?? this.highPrice
      ..id = id ?? this.id
      ..supplierName = supplierName ?? this.supplierName
      ..image = image ?? this.image
      ..brandName = brandName ?? this.brandName
      ..paySingle = paySingle ?? this.paySingle
      ..priceType = priceType ?? this.priceType
      ..specList = specList ?? this.specList
      ..firstClassID = firstClassID ?? this.firstClassID
      ..commodityId = commodityId ?? this.commodityId
      ..sort = sort ?? this.sort
      ..commodityType = commodityType ?? this.commodityType
      ..barCode = barCode ?? this.barCode
      ..spuSpecJsonBody = spuSpecJsonBody ?? this.spuSpecJsonBody
      ..taxRate = taxRate ?? this.taxRate
      ..mainImage = mainImage ?? this.mainImage
      ..priceCost = priceCost ?? this.priceCost
      ..discountLabel = discountLabel ?? this.discountLabel
      ..commodityForm = commodityForm ?? this.commodityForm
      ..brandId = brandId ?? this.brandId
      ..highTaxRate = highTaxRate ?? this.highTaxRate
      ..skuCode = skuCode ?? this.skuCode
      ..commodityName = commodityName ?? this.commodityName
      ..status = status ?? this.status;
  }
}

TopicProductGoodsSpecList $TopicProductGoodsSpecListFromJson(Map<String, dynamic> json) {
  final TopicProductGoodsSpecList topicProductGoodsSpecList = TopicProductGoodsSpecList();
  final double? taxRate = jsonConvert.convert<double>(json['taxRate']);
  if (taxRate != null) {
    topicProductGoodsSpecList.taxRate = taxRate;
  }
  final double? priceCost = jsonConvert.convert<double>(json['priceCost']);
  if (priceCost != null) {
    topicProductGoodsSpecList.priceCost = priceCost;
  }
  final int? specNum = jsonConvert.convert<int>(json['specNum']);
  if (specNum != null) {
    topicProductGoodsSpecList.specNum = specNum;
  }
  final double? price = jsonConvert.convert<double>(json['price']);
  if (price != null) {
    topicProductGoodsSpecList.price = price;
  }
  final double? highPrice = jsonConvert.convert<double>(json['highPrice']);
  if (highPrice != null) {
    topicProductGoodsSpecList.highPrice = highPrice;
  }
  final double? priceMarket = jsonConvert.convert<double>(json['priceMarket']);
  if (priceMarket != null) {
    topicProductGoodsSpecList.priceMarket = priceMarket;
  }
  final double? profit = jsonConvert.convert<double>(json['profit']);
  if (profit != null) {
    topicProductGoodsSpecList.profit = profit;
  }
  return topicProductGoodsSpecList;
}

Map<String, dynamic> $TopicProductGoodsSpecListToJson(TopicProductGoodsSpecList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['taxRate'] = entity.taxRate;
  data['priceCost'] = entity.priceCost;
  data['specNum'] = entity.specNum;
  data['price'] = entity.price;
  data['highPrice'] = entity.highPrice;
  data['priceMarket'] = entity.priceMarket;
  data['profit'] = entity.profit;
  return data;
}

extension TopicProductGoodsSpecListExtension on TopicProductGoodsSpecList {
  TopicProductGoodsSpecList copyWith({
    double? taxRate,
    double? priceCost,
    int? specNum,
    double? price,
    double? highPrice,
    double? priceMarket,
    double? profit,
  }) {
    return TopicProductGoodsSpecList()
      ..taxRate = taxRate ?? this.taxRate
      ..priceCost = priceCost ?? this.priceCost
      ..specNum = specNum ?? this.specNum
      ..price = price ?? this.price
      ..highPrice = highPrice ?? this.highPrice
      ..priceMarket = priceMarket ?? this.priceMarket
      ..profit = profit ?? this.profit;
  }
}

TopicProductBgImage $TopicProductBgImageFromJson(Map<String, dynamic> json) {
  final TopicProductBgImage topicProductBgImage = TopicProductBgImage();
  final String? attachmentUrl = jsonConvert.convert<String>(json['attachment_url']);
  if (attachmentUrl != null) {
    topicProductBgImage.attachmentUrl = attachmentUrl;
  }
  return topicProductBgImage;
}

Map<String, dynamic> $TopicProductBgImageToJson(TopicProductBgImage entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['attachment_url'] = entity.attachmentUrl;
  return data;
}

extension TopicProductBgImageExtension on TopicProductBgImage {
  TopicProductBgImage copyWith({
    String? attachmentUrl,
  }) {
    return TopicProductBgImage()..attachmentUrl = attachmentUrl ?? this.attachmentUrl;
  }
}

TopicProductDefaultGoods $TopicProductDefaultGoodsFromJson(Map<String, dynamic> json) {
  final TopicProductDefaultGoods topicProductDefaultGoods = TopicProductDefaultGoods();
  final String? image = jsonConvert.convert<String>(json['image']);
  if (image != null) {
    topicProductDefaultGoods.image = image;
  }
  final String? price = jsonConvert.convert<String>(json['price']);
  if (price != null) {
    topicProductDefaultGoods.price = price;
  }
  final List<TopicProductDefaultGoodsSpecList>? specList = (json['specList'] as List<dynamic>?)?.map((e) => jsonConvert.convert<TopicProductDefaultGoodsSpecList>(e) as TopicProductDefaultGoodsSpecList).toList();
  if (specList != null) {
    topicProductDefaultGoods.specList = specList;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    topicProductDefaultGoods.id = id;
  }
  final int? saleNum = jsonConvert.convert<int>(json['saleNum']);
  if (saleNum != null) {
    topicProductDefaultGoods.saleNum = saleNum;
  }
  final String? commodityName = jsonConvert.convert<String>(json['commodityName']);
  if (commodityName != null) {
    topicProductDefaultGoods.commodityName = commodityName;
  }
  return topicProductDefaultGoods;
}

Map<String, dynamic> $TopicProductDefaultGoodsToJson(TopicProductDefaultGoods entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['image'] = entity.image;
  data['price'] = entity.price;
  data['specList'] = entity.specList?.map((v) => v.toJson()).toList();
  data['id'] = entity.id;
  data['saleNum'] = entity.saleNum;
  data['commodityName'] = entity.commodityName;
  return data;
}

extension TopicProductDefaultGoodsExtension on TopicProductDefaultGoods {
  TopicProductDefaultGoods copyWith({
    String? image,
    String? price,
    List<TopicProductDefaultGoodsSpecList>? specList,
    int? id,
    int? saleNum,
    String? commodityName,
  }) {
    return TopicProductDefaultGoods()
      ..image = image ?? this.image
      ..price = price ?? this.price
      ..specList = specList ?? this.specList
      ..id = id ?? this.id
      ..saleNum = saleNum ?? this.saleNum
      ..commodityName = commodityName ?? this.commodityName;
  }
}

TopicProductDefaultGoodsSpecList $TopicProductDefaultGoodsSpecListFromJson(Map<String, dynamic> json) {
  final TopicProductDefaultGoodsSpecList topicProductDefaultGoodsSpecList = TopicProductDefaultGoodsSpecList();
  final int? price = jsonConvert.convert<int>(json['price']);
  if (price != null) {
    topicProductDefaultGoodsSpecList.price = price;
  }
  final int? priceMarket = jsonConvert.convert<int>(json['priceMarket']);
  if (priceMarket != null) {
    topicProductDefaultGoodsSpecList.priceMarket = priceMarket;
  }
  return topicProductDefaultGoodsSpecList;
}

Map<String, dynamic> $TopicProductDefaultGoodsSpecListToJson(TopicProductDefaultGoodsSpecList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['price'] = entity.price;
  data['priceMarket'] = entity.priceMarket;
  return data;
}

extension TopicProductDefaultGoodsSpecListExtension on TopicProductDefaultGoodsSpecList {
  TopicProductDefaultGoodsSpecList copyWith({
    int? price,
    int? priceMarket,
  }) {
    return TopicProductDefaultGoodsSpecList()
      ..price = price ?? this.price
      ..priceMarket = priceMarket ?? this.priceMarket;
  }
}

TopicProductSubEntry $TopicProductSubEntryFromJson(Map<String, dynamic> json) {
  final TopicProductSubEntry topicProductSubEntry = TopicProductSubEntry();
  final String? linkType = jsonConvert.convert<String>(json['link_type']);
  if (linkType != null) {
    topicProductSubEntry.linkType = linkType;
  }
  final String? imageUrl = jsonConvert.convert<String>(json['image_url']);
  if (imageUrl != null) {
    topicProductSubEntry.imageUrl = imageUrl;
  }
  final String? linkTitle = jsonConvert.convert<String>(json['link_title']);
  if (linkTitle != null) {
    topicProductSubEntry.linkTitle = linkTitle;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    topicProductSubEntry.title = title;
  }
  final String? linkId = jsonConvert.convert<String>(json['link_id']);
  if (linkId != null) {
    topicProductSubEntry.linkId = linkId;
  }
  final String? desc = jsonConvert.convert<String>(json['desc']);
  if (desc != null) {
    topicProductSubEntry.desc = desc;
  }
  return topicProductSubEntry;
}

Map<String, dynamic> $TopicProductSubEntryToJson(TopicProductSubEntry entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['link_type'] = entity.linkType;
  data['image_url'] = entity.imageUrl;
  data['link_title'] = entity.linkTitle;
  data['title'] = entity.title;
  data['link_id'] = entity.linkId;
  data['desc'] = entity.desc;
  return data;
}

extension TopicProductSubEntryExtension on TopicProductSubEntry {
  TopicProductSubEntry copyWith({
    String? linkType,
    String? imageUrl,
    String? linkTitle,
    String? title,
    String? linkId,
    String? desc,
  }) {
    return TopicProductSubEntry()
      ..linkType = linkType ?? this.linkType
      ..imageUrl = imageUrl ?? this.imageUrl
      ..linkTitle = linkTitle ?? this.linkTitle
      ..title = title ?? this.title
      ..linkId = linkId ?? this.linkId
      ..desc = desc ?? this.desc;
  }
}

TopicProductLink $TopicProductLinkFromJson(Map<String, dynamic> json) {
  final TopicProductLink topicProductLink = TopicProductLink();
  final String? linkType = jsonConvert.convert<String>(json['link_type']);
  if (linkType != null) {
    topicProductLink.linkType = linkType;
  }
  final String? linkTitle = jsonConvert.convert<String>(json['link_title']);
  if (linkTitle != null) {
    topicProductLink.linkTitle = linkTitle;
  }
  final String? linkId = jsonConvert.convert<String>(json['link_id']);
  if (linkId != null) {
    topicProductLink.linkId = linkId;
  }
  return topicProductLink;
}

Map<String, dynamic> $TopicProductLinkToJson(TopicProductLink entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['link_type'] = entity.linkType;
  data['link_title'] = entity.linkTitle;
  data['link_id'] = entity.linkId;
  return data;
}

extension TopicProductLinkExtension on TopicProductLink {
  TopicProductLink copyWith({
    String? linkType,
    String? linkTitle,
    String? linkId,
  }) {
    return TopicProductLink()
      ..linkType = linkType ?? this.linkType
      ..linkTitle = linkTitle ?? this.linkTitle
      ..linkId = linkId ?? this.linkId;
  }
}

TopicProductLinkMore $TopicProductLinkMoreFromJson(Map<String, dynamic> json) {
  final TopicProductLinkMore topicProductLinkMore = TopicProductLinkMore();
  final String? linkType = jsonConvert.convert<String>(json['link_type']);
  if (linkType != null) {
    topicProductLinkMore.linkType = linkType;
  }
  final String? linkTitle = jsonConvert.convert<String>(json['link_title']);
  if (linkTitle != null) {
    topicProductLinkMore.linkTitle = linkTitle;
  }
  final String? linkId = jsonConvert.convert<String>(json['link_id']);
  if (linkId != null) {
    topicProductLinkMore.linkId = linkId;
  }
  return topicProductLinkMore;
}

Map<String, dynamic> $TopicProductLinkMoreToJson(TopicProductLinkMore entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['link_type'] = entity.linkType;
  data['link_title'] = entity.linkTitle;
  data['link_id'] = entity.linkId;
  return data;
}

extension TopicProductLinkMoreExtension on TopicProductLinkMore {
  TopicProductLinkMore copyWith({
    String? linkType,
    String? linkTitle,
    String? linkId,
  }) {
    return TopicProductLinkMore()
      ..linkType = linkType ?? this.linkType
      ..linkTitle = linkTitle ?? this.linkTitle
      ..linkId = linkId ?? this.linkId;
  }
}

TopicProductHdImage2 $TopicProductHdImage2FromJson(Map<String, dynamic> json) {
  final TopicProductHdImage2 topicProductHdImage2 = TopicProductHdImage2();
  final String? attachmentUrl = jsonConvert.convert<String>(json['attachment_url']);
  if (attachmentUrl != null) {
    topicProductHdImage2.attachmentUrl = attachmentUrl;
  }
  return topicProductHdImage2;
}

Map<String, dynamic> $TopicProductHdImage2ToJson(TopicProductHdImage2 entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['attachment_url'] = entity.attachmentUrl;
  return data;
}

extension TopicProductHdImage2Extension on TopicProductHdImage2 {
  TopicProductHdImage2 copyWith({
    String? attachmentUrl,
  }) {
    return TopicProductHdImage2()..attachmentUrl = attachmentUrl ?? this.attachmentUrl;
  }
}

TopicProductHdImage $TopicProductHdImageFromJson(Map<String, dynamic> json) {
  final TopicProductHdImage topicProductHdImage = TopicProductHdImage();
  final String? attachmentUrl = jsonConvert.convert<String>(json['attachment_url']);
  if (attachmentUrl != null) {
    topicProductHdImage.attachmentUrl = attachmentUrl;
  }
  return topicProductHdImage;
}

Map<String, dynamic> $TopicProductHdImageToJson(TopicProductHdImage entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['attachment_url'] = entity.attachmentUrl;
  return data;
}

extension TopicProductHdImageExtension on TopicProductHdImage {
  TopicProductHdImage copyWith({
    String? attachmentUrl,
  }) {
    return TopicProductHdImage()..attachmentUrl = attachmentUrl ?? this.attachmentUrl;
  }
}
